<template>
  <section class="jumbotron">
    <h3 class="jumbotron-heading">Search Github Users</h3>
    <div>
      <input type="text" placeholder="enter the name you search" v-model="searchName"/>
      <button @click="search">Search</button>
    </div>
  </section>
</template>

<script lang="ts">
  export default {
    name: 'SearchHeader'
  }
</script>
<script lang="ts" setup>
import { ref } from 'vue';
import {useUserSearchStore} from '@/stores/userSearch'
const searchName = ref('')

const userSearchStore = useUserSearchStore()
const search = () => {
  if (searchName.value) {
    userSearchStore.search(searchName.value)
    searchName.value = ''
  }
}
</script>

<style scoped>

 
</style>
